city_names = "Hohhot Baotou Chifeng Ordos"
print("--- 字符串拆分与基础处理 ---")
individual_cities = city_names.split()
print(f"拆分后: {individual_cities}")
city_mixed = "HoHhOt"  # 呼和浩特的音译混合大小写
print("--- 大小写转换 ---")
print(f"转大写: '{city_mixed.upper()}'")
print(f"转小写: '{city_mixed.lower()}'")
repl_txt = "Hohhot is a city, Hohhot is beautiful!"
print("--- 替换操作 ---")
print(f"原文本: '{repl_txt}'")
# 替换 'Hohhot' 为 'Ordos'
print(f"{repl_txt.replace('Hohhot', 'Ordos')}")
# 替换第一个 'Hohhot'
print(f"{repl_txt.replace('Hohhot', 'Xilinhot', 1)}")
city_whitespace = "   Tongliao   "
print("--- 空白字符处理 ---")
print(f"原城市名 (带空白): '{city_whitespace}'")
print(f"移除首尾空: '{city_whitespace.strip()}'")
print(f"移除左侧空: '{city_whitespace.lstrip()}'")
print(f"移除右侧空: '{city_whitespace.rstrip()}'")
city_dashes = "---Ordos---"
print(f"移除'-': '{city_dashes.strip('-')}'")
